home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / MEMMOVE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  428 b   |  12 lines

  1. /* memmove.c, from p.154 of Turbo C Bible  */
  2. /* Copies a specified number of bytes from one buffer to another
  3.         (handles overlapping source and destination. */
  4. #include <stdio.h>
  5. #include <mem.h>
  6. static char src[80] = "FirstSecond";
  7. main()
  8. {
  9.     printf("Before memmove: Source = %s\n", src);
  10.     memmove(&src[5], src, sizeof(src)); /* Copy from source to itself         */
  11.     printf("After  memmove: Source = %s\n", src);
  12. }